package com.jsu.clubmanagementsystem.service.club;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jsu.clubmanagementsystem.common.PageRequest;
import com.jsu.clubmanagementsystem.model.entity.ClubMembership;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jsu.clubmanagementsystem.model.vo.club.ListMemberVO;

/**
* @author 24753
* @description 针对表【club_membership(社团人员关系)】的数据库操作Service
* @createDate 2025-05-13 17:19:16
*/
public interface ClubMembershipService extends IService<ClubMembership> {

    /**
     * 用户是否为该社团成员
     *
     * @param clubId
     * @param userId
     * @return
     */
    boolean isMemberOfClub(Long userId, Long clubId);

    /**
     * 用户是否同时加入少于三个社团
     *
     * @param userId
     * @return
     */
    boolean isUserInLessThan3Club(long userId);

    /**
     * 获取查询封装
     *
     * @param userId
     * @param clubId
     * @return
     */
    QueryWrapper<ClubMembership> getQueryWrapper(Long userId, Long clubId);

    Page<ListMemberVO> getListMemberVO(PageRequest pageRequest);

    boolean addUserToClub(Long userId, Long clubId);

    void quitClub(Long userId,Long clubId);

}
